package ops.model.manager;

import java.io.File;

import ops.model.Teacher;


public class TeacherManager extends EntityManager<Teacher> {

	private static final File TEACHERS_FILE = new File("data/teachers.dat");
	
	public TeacherManager() {
		super();
	}
	
	@Override
	public File getFile() {
		return TEACHERS_FILE;
	}

	@Override
	protected Object getKeyForEntity(Teacher element) {
		return element.getCode();
	}
	
	
	//TODO : maybe we should associate teachers to classes... like the Students. 
	//@Override
	/*public Teacher remove(Object key) {
		Map<Object, Teacher> teachers = EntityController.getInstance().getTeacherManager().getModifiableMap();
		for (Teacher teacher : teachers.values()) {
			for (Iterator<Entry<Long, Double>> iter = teacher.getStudentsGrade().entrySet().iterator(); iter.hasNext();) {
				if (iter.next().getKey() == key) {
					iter.remove();
					break; // no need to iterate anymore since the key is unique!
				}
			}
		}
		
		//students.remove(studentCode);
		
		return super.remove(key);
	}*/

}
